import request from '@/utils/request'
import requestTest from '@/utils/request'

// 测试
export function test (data) {
  return requestTest({
    url: '/restapi/user/shop',
    method: 'get',
    params: data,
    headers: {
      // 'Content-Type': 'application/json',
      'apikey':'RpPtRRGlscEefioZMb9JenoNjVQw9qOA',
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查询规则
export function getRule (data) {
  return request({
    url: '/rules/getPage',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增规则
export function addRule (data) {
  return request({
    url: '/rules/addRules',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}



// 修改规则
export function updateRule (data) {
  return request({
    url: '/rules/updateRules',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}